<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="迁移到Github Action, 个人博客，柠檬之翼，笔记，文章">
    <meta name="description" content="迁移到``Github-Action说明博客很久没有维护更新了，每年也就春节前后得空才有时间写写总结，然后更新一下。由于博客直接部署了Travis CI持续集成，可以参考之前的文章[[2020-02-06-使用TravisCI持续集成]],">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <title>迁移到Github Action | 嘟嘟嘴的窝</title>
    <link rel="icon" type="image/png" href="/favicon.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/all.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">
    
    <script src="/libs/jquery/jquery.min.js"></script>
    
<meta name="generator" content="Hexo 4.2.0"><link rel="alternate" href="/atom.xml" title="嘟嘟嘴的窝" type="application/atom+xml">
<link rel="stylesheet" href="/css/prism-tomorrow.css" type="text/css"></head>


<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/" class="waves-effect waves-light">
                    
                    <img src="/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">嘟嘟嘴的窝</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>

<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">嘟嘟嘴的窝</div>
        <div class="logo-desc">
            
            分享个人学习笔记，记录生活
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        
    </ul>
</div>

        </div>

        
    </nav>

</header>

    
<script src="/libs/cryptojs/crypto-js.min.js"></script>
<script>
    (function() {
        let pwd = '';
        if (pwd && pwd.length > 0) {
            if (pwd !== CryptoJS.SHA256(prompt('请输入访问本文章的密码')).toString(CryptoJS.enc.Hex)) {
                alert('密码错误，将返回主页！');
                location.href = '/';
            }
        }
    })();
</script>




<div class="bg-cover pd-header post-cover" style="background-image: url('/medias/featureimages/13.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">迁移到Github Action</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        margin: 35px 0 15px 0;
        padding-left: 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        height: calc(100vh - 250px);
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #toc-content .is-active-link::before {
        background-color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/tags/github/">
                                <span class="chip bg-color">github</span>
                            </a>
                        
                            <a href="/tags/action/">
                                <span class="chip bg-color">action</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/categories/%E6%8A%80%E6%9C%AF%E6%96%87%E7%AB%A0/" class="post-category">
                                技术文章
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2023-03-11
                </div>
                

                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    2.3k
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-clock fa-fw"></i>阅读时长:&nbsp;&nbsp;
                    11 分
                </div>
                

                
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="far fa-eye fa-fw"></i>阅读次数:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>

        </div>
        <hr class="clearfix">
        <div class="card-content article-card-content">
            <div id="articleContent">
                <h1 id="迁移到-Github-Action"><a href="#迁移到-Github-Action" class="headerlink" title="迁移到``Github-Action"></a>迁移到``Github-Action</h1><h2 id="说明"><a href="#说明" class="headerlink" title="说明"></a>说明</h2><p>博客很久没有维护更新了，每年也就春节前后得空才有时间写写总结，然后更新一下。由于博客直接部署了<code>Travis CI</code>持续集成，可以参考之前的文章[[2020-02-06-使用TravisCI持续集成]], 也是非常省心。可是今天突然发现不能使用了，一顿抓狂。<br>后来仔细看了下<code>Travis CI</code>的说明，原来是修改了使用规格，在免费额度使用完以后，就必须收费才可以使用。这也倒不奇怪，作为免费使用的业务，以及方便了非常多的开源项目进行持续集成。随着<code>github</code>推出官方的<code>github action</code>持续集成工具后，市场空间不断被压缩，为求生存，收费也是可以理解的。<br>不过，作为一个不愿花钱的个人而言，交钱买服务，实在是没有必要，毕竟也不便宜。所以今天得空，打算研究下<code>github action</code> 想办法完成切换。</p>
<h2 id="切换步骤"><a href="#切换步骤" class="headerlink" title="切换步骤"></a>切换步骤</h2><blockquote>
<p>参考文章：<a href="https://zhuanlan.zhihu.com/p/161969042" target="_blank" rel="noopener">https://zhuanlan.zhihu.com/p/161969042</a></p>
</blockquote>
<h3 id="创建Github-Persional-Access-Token"><a href="#创建Github-Persional-Access-Token" class="headerlink" title="创建Github Persional Access Token"></a>创建<code>Github Persional Access Token</code></h3><p>主要生成方法可以见[[2020-02-06-使用TravisCI持续集成#^b293ba]]</p>
<h3 id="设置仓库Secrets"><a href="#设置仓库Secrets" class="headerlink" title="设置仓库Secrets"></a>设置仓库<code>Secrets</code></h3><p>找到<code>hexo-source</code>这个源代码仓库，注意不是部署<code>page</code>的仓库，是源代码仓库。找到<code>Settings</code>，左边栏选择 <code>Secrets and variables--&gt;Actions</code>，点击<code>New repository secret</code>进行添加。我这里把<code>Name</code>写为<code>GIT_REPO_TOKEN</code>,然后内容写上面一步申请到的<code>Persional Access Token</code>。为了保持和之前的内容同步，这里顺便也把<code>coding</code>和<code>gitee</code>同步添加下。<br>汇总如下，一共添加了3个<code>token</code>，一个<code>username</code></p>
<ul>
<li><code>GIT_REPO_TOKEN</code></li>
<li><code>CODING_REOP_TOKEN</code></li>
<li><code>GITEE_REPO_TOKEN</code></li>
<li><code>CODING_USER_NAME</code></li>
</ul>
<h3 id="创建工作流脚本"><a href="#创建工作流脚本" class="headerlink" title="创建工作流脚本"></a>创建工作流脚本</h3><p>在<code>hexo-source</code>源码仓库下面新建目录<code>.github/workflows</code>，这是<code>action</code>脚本的目录，里面使用<code>*.yml</code>脚本，即采用<code>YAML格式</code>，文件名可以任意起，我这里就叫为<code>myblogci.yml</code><br>具体的内容如下：</p>
<pre class=" language-shell"><code class="language-shell"># workflow的名称
name: lmwings blog actions

# 触发条件：在 push 到 master 触发wrokflow
on:
  push:
    branches: 
      - master

env:
  TZ: Asia/Shanghai

#定义每一项job
jobs:
  lmwings-blog:
    name: lmwings blog build & deploy
    runs-on: ubuntu-latest # 使用最新的 Ubuntu 系统作为编译部署的环境

    steps:
    # step1: 拉取代码
    - name: Checkout codes
      uses: actions/checkout@v2 

    # step2: 设置 node.js 环境
    - name: Use Node.js 12.x
      uses: actions/setup-node@v1 
      with:
        node-version: '12.x'

    # step3: 设置包缓存目录，避免每次下载
    - name: Cache node modules
      uses: actions/cache@v2
      env:
        cache-name: cache-node-modules
      with:
        path: ~/.npm
        key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
        restore-keys: |
            ${{ runner.os }}-build-${{ env.cache-name }}-
            ${{ runner.os }}-build -
            ${{ runner.os}}-

    # step4: 下载 hexo-cli 脚手架及相关安装包,其中travis_env_init.sh是自己定义的文件
    - name: Install hexo dependencies
      env: 
        GIT_REPO_TOKEN: ${{ secrets.GIT_REPO_TOKEN }}
        GITEE_REPO_TOKEN: ${{ secrets.GITEE_REPO_TOKEN }}
        CODING_REPO_TOKEN: ${{ secrets.CODING_REPO_TOKEN }}
        CODING_USER_NAME: ${{ secrets.CODING_USER_NAME }}    
      run: |
        sh travis_env_init.sh

    # step5: 编译
    - name: Build Generate files
      run: |
        hexo clean
        hexo generate

    # step6: 部署
    - name: Deploy lmwings blog
      # 通过hexo的deploy命令将编译后的blog推送到pages仓库
      run: |
        cd ./public && git init && git add .
        git config --global user.name "lmwings"
        git config --global user.email "1321559220@qq.com"
        hexo deploy > /dev/null
</code></pre>
<p>提交上面的脚本后，发现并没有运行成功，下面是遇到的问题：<br>问题1：后台查看<code>action</code>的运行日志，发现提升<code>npm</code>安装不成功</p>
<pre class=" language-shell"><code class="language-shell">npm ERR! code EEXIST

[38](https://github.com/lmwings/hexo-source/actions/runs/4395938659/jobs/7698063505#step:5:39)npm ERR! syscall symlink

[39](https://github.com/lmwings/hexo-source/actions/runs/4395938659/jobs/7698063505#step:5:40)npm ERR! path ../lib/node_modules/hexo-cli/bin/hexo

[40](https://github.com/lmwings/hexo-source/actions/runs/4395938659/jobs/7698063505#step:5:41)npm ERR! dest /opt/hostedtoolcache/node/12.22.12/x64/bin/hexo

[41](https://github.com/lmwings/hexo-source/actions/runs/4395938659/jobs/7698063505#step:5:42)npm ERR! errno -17

[42](https://github.com/lmwings/hexo-source/actions/runs/4395938659/jobs/7698063505#step:5:43)npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/hexo-cli/bin/hexo' -> '/opt/hostedtoolcache/node/12.22.12/x64/bin/hexo'

[43](https://github.com/lmwings/hexo-source/actions/runs/4395938659/jobs/7698063505#step:5:44)npm ERR! File exists: /opt/hostedtoolcache/node/12.22.12/x64/bin/hexo

[44](https://github.com/lmwings/hexo-source/actions/runs/4395938659/jobs/7698063505#step:5:45)npm ERR! Remove the existing file and try again, or run npm

[45](https://github.com/lmwings/hexo-source/actions/runs/4395938659/jobs/7698063505#step:5:46)npm ERR! with --force to overwrite files recklessly.

[46](https://github.com/lmwings/hexo-source/actions/runs/4395938659/jobs/7698063505#step:5:47)

[47](https://github.com/lmwings/hexo-source/actions/runs/4395938659/jobs/7698063505#step:5:48)npm ERR! A complete log of this run can be found in:

[48](https://github.com/lmwings/hexo-source/actions/runs/4395938659/jobs/7698063505#step:5:49)npm ERR! /home/runner/.npm/_logs/2023-03-12T05_25_33_207Z-debug.log

[49](https://github.com/lmwings/hexo-source/actions/runs/4395938659/jobs/7698063505#step:5:50)Error: Process completed with exit code 239.</code></pre>
<p>解决方式：<br>因为前面已经加载过<code>node</code>环境，所以下面这个不需要再安装</p>
<pre class=" language-shell"><code class="language-shell">#注释掉下面这句
#npm install -g hexo</code></pre>
<p>问题二：发现插件<code>hexo-permalink-pyinyin</code>安装存在问题</p>
<pre class=" language-shell"><code class="language-shell">npm ERR! code E404

[106](https://github.com/lmwings/hexo-source/actions/runs/4395992399/jobs/7698144884#step:4:107)npm ERR! 404 Not Found - GET [https://registry.npmjs.org/hexo-permalink-pyinyin](https://registry.npmjs.org/hexo-permalink-pyinyin) - Not found

[107](https://github.com/lmwings/hexo-source/actions/runs/4395992399/jobs/7698144884#step:4:108)npm ERR! 404

[108](https://github.com/lmwings/hexo-source/actions/runs/4395992399/jobs/7698144884#step:4:109)npm ERR! 404 'hexo-permalink-pyinyin@latest' is not in the npm registry.

[109](https://github.com/lmwings/hexo-source/actions/runs/4395992399/jobs/7698144884#step:4:110)npm ERR! 404 You should bug the author to publish it (or use the name yourself!)

[110](https://github.com/lmwings/hexo-source/actions/runs/4395992399/jobs/7698144884#step:4:111)npm ERR! 404

[111](https://github.com/lmwings/hexo-source/actions/runs/4395992399/jobs/7698144884#step:4:112)npm ERR! 404 Note that you can also install from a

[112](https://github.com/lmwings/hexo-source/actions/runs/4395992399/jobs/7698144884#step:4:113)npm ERR! 404 tarball, folder, http url, or git url</code></pre>
<p>解决方法：<br>暂时注释下下面的插件：</p>
<pre class=" language-shell"><code class="language-shell">npm i hexo-permalink-pyinyin --save</code></pre>
<p>但是我的博客文章名称一般都是中文的，所以去掉这个插件其实是不合适的。可以代替的插件<code>npm install hexo-abbrlink --save</code>，后续也可以使用这个插件。<br>进一步分析发现，<code>action</code>使用的默认源是<code>registry.npmjs.org</code>,而这个插件的作者只发布到了<code>npmjs.com</code>,所以应该只要修改下<code>registry</code>就可以。<br>为了统一，这里统一设置为阿里源，目前名字已经修改。同时使用<code>cnpm</code>进行安装，在这个源里面提前搜索了下，有这个插件存在。</p>
<pre class=" language-shell"><code class="language-shell">npm install -g cnpm --registry=https://registry.npmmirror.com
cnpm install hexo-permalink-pinyin</code></pre>
<p>实际提交后，遇到了新的问题。</p>
<p>问题三：出现安装<code>cnpm</code>失败</p>
<pre class=" language-shell"><code class="language-shell">+ cnpm@9.0.1

[346](https://github.com/lmwings/hexo-source/actions/runs/4396290772/jobs/7698636976#step:4:347)added 672 packages from 246 contributors in 73.771s

[347](https://github.com/lmwings/hexo-source/actions/runs/4396290772/jobs/7698636976#step:4:348)internal/modules/cjs/loader.js:818

[348](https://github.com/lmwings/hexo-source/actions/runs/4396290772/jobs/7698636976#step:4:349) throw err;

[349](https://github.com/lmwings/hexo-source/actions/runs/4396290772/jobs/7698636976#step:4:350) ^

[350](https://github.com/lmwings/hexo-source/actions/runs/4396290772/jobs/7698636976#step:4:351)

[351](https://github.com/lmwings/hexo-source/actions/runs/4396290772/jobs/7698636976#step:4:352)Error: Cannot find module 'fs/promises'

[352](https://github.com/lmwings/hexo-source/actions/runs/4396290772/jobs/7698636976#step:4:353)Require stack:

[353](https://github.com/lmwings/hexo-source/actions/runs/4396290772/jobs/7698636976#step:4:354)- /opt/hostedtoolcache/node/12.22.1</code></pre>
<p>发现这个是一个共性的问题，应该是<code>cnpm</code>和<code>node</code>版本匹配的问题，所以使用低版本的<code>cnpm</code>安装。<br>解决方法：安装低版本比如7.1.0版本</p>
<pre class=" language-shell"><code class="language-shell">npm uninstall -g cnpm
npm install -g cnpm@7.1.0 --registry=https://registry.npmmirror.com
cnpm install hexo-permalink-pinyin</code></pre>
<p>问题四：解决了上面的问题以后，还剩下最后一个问题</p>
<pre class=" language-shell"><code class="language-shell">To [https://github.com/lmwings/lmwings.github.io.git](https://github.com/lmwings/lmwings.github.io.git)

[31](https://github.com/lmwings/hexo-source/actions/runs/4396352677/jobs/7698733700#step:6:32) + e487ca3...08d0a07 HEAD -> master (forced update)

[32](https://github.com/lmwings/hexo-source/actions/runs/4396352677/jobs/7698733700#step:6:33)To [https://e.coding.net/lmwings/lmwings.git](https://e.coding.net/lmwings/lmwings.git)

[33](https://github.com/lmwings/hexo-source/actions/runs/4396352677/jobs/7698733700#step:6:34) + e487ca3...08d0a07 HEAD -> master (forced update)

[34](https://github.com/lmwings/hexo-source/actions/runs/4396352677/jobs/7698733700#step:6:35)fatal: could not read Password for 'https://***@gitee.com': No such device or address

[35](https://github.com/lmwings/hexo-source/actions/runs/4396352677/jobs/7698733700#step:6:36)FATAL Something's wrong. Maybe you can find the solution here: [https://hexo.io/docs/troubleshooting.html](https://hexo.io/docs/troubleshooting.html)

[36](https://github.com/lmwings/hexo-source/actions/runs/4396352677/jobs/7698733700#step:6:37)Error: Spawn failed

[37](https://github.com/lmwings/hexo-source/actions/runs/4396352677/jobs/7698733700#step:6:38) at ChildProcess.<anonymous> (/home/runner/work/hexo-source/hexo-source/node_modules/hexo-util/lib/spawn.js:51:21)

[38](https://github.com/lmwings/hexo-source/actions/runs/4396352677/jobs/7698733700#step:6:39) at ChildProcess.emit (events.js:314:20)

[39](https://github.com/lmwings/hexo-source/actions/runs/4396352677/jobs/7698733700#step:6:40) at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)

[40](https://github.com/lmwings/hexo-source/actions/runs/4396352677/jobs/7698733700#step:6:41)Error: Process completed with exit code 2.</code></pre>
<p>可以看到这个是部署过程中的异常，主要是提交到国内平台<code>gitee</code>和<code>coding</code>出现了异常。之前为了国内访问速度快一些，特意做的分流出来，由于长时间没有维护，国内代码平台规则变更，导致的问题。这个只要重新申请对应平台的<code>tocken</code>就ok</p>
<h3 id="总结和反思"><a href="#总结和反思" class="headerlink" title="总结和反思"></a>总结和反思</h3><p>总的来说，切换难度不大。遇到的问题都为本身软件包安装的问题。由于国内代码平台规则升级频繁，需要常常关注，否则就很容易出问题，后续打算同步部署到<code>Vercel</code>中。</p>
<script>
        document.querySelectorAll('.github-emoji')
          .forEach(el => {
            if (!el.dataset.src) { return; }
            const img = document.createElement('img');
            img.style = 'display:none !important;';
            img.src = el.dataset.src;
            img.addEventListener('error', () => {
              img.remove();
              el.style.color = 'inherit';
              el.style.backgroundImage = 'none';
              el.style.background = 'none';
            });
            img.addEventListener('load', () => {
              img.remove();
            });
            document.body.appendChild(img);
          });
      </script>
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="http://www.lmwings.top" rel="external nofollow noreferrer">Wang Kang</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="http://www.lmwings.top/qian-yi-dao-github-action.html">http://www.lmwings.top/qian-yi-dao-github-action.html</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="http://www.lmwings.top" target="_blank">Wang Kang</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/tags/github/">
                                    <span class="chip bg-color">github</span>
                                </a>
                            
                                <a href="/tags/action/">
                                    <span class="chip bg-color">action</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">

<div id="article-share">
    
    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>
            
        </div>
    </div>

    
        <link rel="stylesheet" href="/libs/gitalk/gitalk.css">
<link rel="stylesheet" href="/css/my-gitalk.css">

<div class="card gitalk-card" data-aos="fade-up">
    <div class="comment_headling" style="font-size: 20px; font-weight: 700; position: relative; left: 20px; top: 15px; padding-bottom: 5px;">
        <i class="fas fa-comments fa-fw" aria-hidden="true"></i>
        <span>评论</span>
    </div>
    <div id="gitalk-container" class="card-content"></div>
</div>

<script src="/libs/gitalk/gitalk.min.js"></script>
<script>
    let gitalk = new Gitalk({
        clientID: '0123e9f950656f3c89b6',
        clientSecret: '7ed5378272d9a12cf3be09c4cde0d24015b200b1',
        repo: 'lmwings.github.io',
        owner: 'lmwings',
        admin: "lmwings",
        id: '2023-03-11T19-39-09',
        distractionFreeMode: false  // Facebook-like distraction free mode
    });

    gitalk.render('gitalk-container');
</script>
    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/coding-shang-bu-shu-jing-tai-ye-mian.html">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/7.jpg" class="responsive-img" alt="coding上部署静态页面">
                        
                        <span class="card-title">coding上部署静态页面</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            coding上部署静态页面官方教程：https://coding.net/help/docs/devops/ci/practice/static-website-paas.html
通过「持续集成」把 HTML 自动部署到「云存储」，变成静
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2023-03-12
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/%E7%BD%91%E7%AB%99%E5%BB%BA%E8%AE%BE/" class="post-category">
                                    网站建设
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/hexo/">
                        <span class="chip bg-color">hexo</span>
                    </a>
                    
                    <a href="/tags/coding/">
                        <span class="chip bg-color">coding</span>
                    </a>
                    
                    <a href="/tags/%E7%BD%91%E7%AB%99%E9%83%A8%E7%BD%B2/">
                        <span class="chip bg-color">网站部署</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/chatgpt-zhu-ce-he-shi-yong.html">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/14.jpg" class="responsive-img" alt="chatGPT注册和使用">
                        
                        <span class="card-title">chatGPT注册和使用</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            chatGPT注册和使用
https://openai.com/blog/chatgpt/

注册需要美国手机号，同时登陆访问需要国外的ip地址
验证手机号准备可以通过在线打码平台进行。如sms-activate
直接注册需要事先准备好邮箱
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2023-02-08
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/%E5%B7%A5%E5%85%B7%E6%8E%A8%E8%8D%90/" class="post-category">
                                    工具推荐
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/openai/">
                        <span class="chip bg-color">openai</span>
                    </a>
                    
                    <a href="/tags/chatGPT/">
                        <span class="chip bg-color">chatGPT</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>


<script>
    $('#articleContent').on('copy', function (e) {
        // IE8 or earlier browser is 'undefined'
        if (typeof window.getSelection === 'undefined') return;

        var selection = window.getSelection();
        // if the selection is short let's not annoy our users.
        if (('' + selection).length < Number.parseInt('120')) {
            return;
        }

        // create a div outside of the visible area and fill it with the selected text.
        var bodyElement = document.getElementsByTagName('body')[0];
        var newdiv = document.createElement('div');
        newdiv.style.position = 'absolute';
        newdiv.style.left = '-99999px';
        bodyElement.appendChild(newdiv);
        newdiv.appendChild(selection.getRangeAt(0).cloneContents());

        // we need a <pre> tag workaround.
        // otherwise the text inside "pre" loses all the line breaks!
        if (selection.getRangeAt(0).commonAncestorContainer.nodeName === 'PRE') {
            newdiv.innerHTML = "<pre>" + newdiv.innerHTML + "</pre>";
        }

        var url = document.location.href;
        newdiv.innerHTML += '<br />'
            + '来源: 嘟嘟嘴的窝<br />'
            + '文章作者: 柠檬之翼<br />'
            + '文章链接: <a href="' + url + '">' + url + '</a><br />'
            + '本文章著作权归作者所有，任何形式的转载都请注明出处。';

        selection.selectAllChildren(newdiv);
        window.setTimeout(function () {bodyElement.removeChild(newdiv);}, 200);
    });
</script>


<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/libs/codeBlock/codeShrink.js"></script>


<!-- 代码块折行 -->

<style type="text/css">
code[class*="language-"], pre[class*="language-"] { white-space: pre !important; }
</style>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>



    <footer class="page-footer bg-color">
    <div class="container row center-align" style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            <span id="year">2019</span>
            <a href="http://www.lmwings.top" target="_blank">柠檬之翼</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            &nbsp;<i class="fas fa-chart-area"></i>&nbsp;站点总字数:&nbsp;<span
                class="white-color">31.2k</span>&nbsp;字
            
            
            
            
            
            
            <span id="busuanzi_container_site_pv">
                |&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;<span id="busuanzi_value_site_pv"
                    class="white-color"></span>&nbsp;次
            </span>
            
            
            <span id="busuanzi_container_site_uv">
                |&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;<span id="busuanzi_value_site_uv"
                    class="white-color"></span>&nbsp;人
            </span>
            
            <br>
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/lmwings" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:1321559220@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=1321559220" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 1321559220" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







    <a href="/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fas fa-rss"></i>
    </a>

</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script src="/js/search.js"></script>
<script type="text/javascript">
$(function () {
    searchFunc("/" + "search.xml", 'searchInput', 'searchResult');
});
</script>
    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/libs/materialize/materialize.min.js"></script>
    <script src="/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/libs/aos/aos.js"></script>
    <script src="/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/js/matery.js"></script>

    <!-- Global site tag (gtag.js) - Google Analytics -->


    <!-- Baidu Analytics -->

<script>
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?6fdfb99af350f72ffa28464cc4abaa04";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    

    

    
    
    
    <script src="/libs/instantpage/instantpage.js" type="module"></script>
    

</body>

</html>
